-
Notifications
You must be signed in to change notification settings - Fork 43
teams: smoother survey submissions formatting (fixes #9285) #9308
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
|
@codex review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
paulbert
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry I got caught up a little today. Haven't been able to test yet, but wanted to add these comments on what I was able to read through.
| ...submission, | ||
| teamInfo: submission.team ? { name: submission.team.name, type: submission.team.type } : null | ||
| })); | ||
| return of<[any[], number, string[]]>([submissionsWithTeamInfo, time, questionTexts]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few things that were here before that could be improved:
- This doesn't need to be a switchMap, it can just be a map since it's returning a static value not another observable. Then you can remove the of and just return the array on this line.
- I think the indentation was a little off here. Bumping the switchMap, or map, down to a new line and then indenting the function would make this clearer.
| }) | ||
| ).pipe(map((updatedSubmissions: any[]): [ any[], number, string[] ] => [ updatedSubmissions, time, questionTexts ]) | ||
| ); | ||
| return of<[any[], number, string[]]>([submissionsWithPlanetName, time, questionTexts]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same, since we're no longer pulling in team info here via another observable we can just use a map instead of switchMap and return the array.
|
I tried to test, but honestly I'm a bit confused about the expected user experience here. As a manager I created a survey and sent it to a team. Then I logged in as a member of that team, but there wasn't a request to take the survey. I saw that the survey is available now in the team's list of surveys as a survey to record responses from the community. I was curious how this differed from the team created surveys, and saw that when a team creates a survey there isn't a submissions document. That's more what I would expect on the database side for this kind of team survey. A submission document should be specific record of a survey or exam submission. I might be missing something, but I'm having trouble seeing why this workflow is using the submissions database at all? |
Fixes #9285 #9067
Improve submissions document format:
Add source to PDF/CSV exports